package cn.cloud.all.security.access.event;

import cn.cloud.all.security.access.ConfigAttribute;
import cn.cloud.all.security.authentication.exception.AuthenticationCredentialsNotFoundException;

import java.util.Collection;

public class AuthenticationCredentialsNotFoundEvent extends AbstractAuthorizationEvent {

	private Collection<ConfigAttribute> configAttribs;
	private AuthenticationCredentialsNotFoundException credentialsNotFoundException;

    public AuthenticationCredentialsNotFoundEvent(Object secureObject,
                                                  Collection<ConfigAttribute> attributes,
                                                  AuthenticationCredentialsNotFoundException credentialsNotFoundException) {
        super(secureObject);

        if ((attributes == null) || (credentialsNotFoundException == null)) {
            throw new IllegalArgumentException("All parameters are required and cannot be null");
        }

        this.configAttribs = attributes;
        this.credentialsNotFoundException = credentialsNotFoundException;
    }

    public Collection<ConfigAttribute> getConfigAttributes() {
        return configAttribs;
    }

    public AuthenticationCredentialsNotFoundException getCredentialsNotFoundException() {
        return credentialsNotFoundException;
    }
}
